package com.ll.crud.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * 2020/9/28 - 21:59
 */
public class UtilRandom {
    public void showRandomName() {
        String firstName = "赵钱孙李，周吴郑王。\n" +
                "冯陈褚卫，蒋沈韩杨。\n" +
                "朱秦尤许，何吕施张。\n" +
                "孔曹严华，金魏陶姜。\n" +
                "戚谢邹喻，柏水窦章。\n" +
                "云苏潘葛，奚范彭郎。\n" +
                "鲁韦昌马，苗凤花方。\n" +
                "俞任袁柳，酆鲍史唐。\n" +
                "费廉岑薛，雷贺倪汤。\n" +
                "滕殷罗毕，郝邬安常。\n" +
                "乐于时傅，皮卞齐康。\n" +
                "伍余元卜，顾孟平黄。\n" +
                "和穆萧尹，姚邵湛汪。\n" +
                "祁毛禹狄，米贝明臧。\n" +
                "计伏成戴，谈宋茅庞。\n" +
                "熊纪舒屈，项祝董梁。\n" +
                "杜阮蓝闵，席季麻强。\n" +
                "贾路娄危，江童颜郭。\n" +
                "梅盛林刁，钟徐邱骆。\n" +
                "高夏蔡田，樊胡凌霍。\n" +
                "虞万支柯，昝管卢莫。\n" +
                "经房裘缪，干解应宗。\n" +
                "丁宣贲邓，郁单杭洪。\n" +
                "包诸左石，崔吉钮龚。\n" +
                "程嵇邢滑，裴陆荣翁。\n" +
                "荀羊於惠，甄曲家封。\n" +
                "芮羿储靳，汲邴糜松。\n" +
                "井段富巫，乌焦巴弓。\n" +
                "牧隗山谷，车侯宓蓬。\n" +
                "全郗班仰，秋仲伊宫。\n" +
                "宁仇栾暴，甘钭厉戎。\n" +
                "祖武符刘，景詹束龙。\n" +
                "叶幸司韶，郜黎蓟薄。\n" +
                "印宿白怀，蒲邰从鄂。\n" +
                "索咸籍赖，卓蔺屠蒙。\n" +
                "池乔阴鬱，胥能苍双。\n" +
                "闻莘党翟，谭贡劳逄。\n" +
                "姬申扶堵，冉宰郦雍。\n" +
                "卻璩桑桂，濮牛寿通。\n" +
                "边扈燕冀，郏浦尚农。\n" +
                "温别庄晏，柴瞿阎充。\n" +
                "慕连茹习，宦艾鱼容。\n" +
                "向古易慎，戈廖庾终。\n" +
                "暨居衡步，都耿满弘。\n" +
                "匡国文寇，广禄阙东。\n" +
                "欧殳沃利，蔚越夔隆。\n" +
                "师巩厍聂，晁勾敖融。\n" +
                "冷訾辛阚，那简饶空。\n" +
                "曾毋沙乜，养鞠须丰。\n" +
                "巢关蒯相，查后荆红。\n" +
                "游竺权逯，盖益桓公。\n" +
                "万俟司马，上官欧阳。\n" +
                "夏侯诸葛，闻人东方。\n" +
                "赫连皇甫，尉迟公羊。\n" +
                "澹台公冶，宗政濮阳。\n" +
                "淳于单于，太叔申屠。\n" +
                "公孙仲孙，轩辕令狐。\n" +
                "钟离宇文，长孙慕容。\n" +
                "鲜于闾丘，司徒司空。\n" +
                "丌官司寇，仉督子车。\n" +
                "颛孙端木，巫马公西。\n" +
                "漆雕乐正，壤驷公良。\n" +
                "拓跋夹谷，宰父谷梁。\n" +
                "晋楚闫法，汝鄢涂钦。\n" +
                "段干百里，东郭南门。\n" +
                "呼延归海，羊舌微生。\n" +
                "岳帅缑亢，况郈有琴。\n" +
                "梁丘左丘，东门西门。\n" +
                "商牟佘佴，伯赏南宫。\n" +
                "墨哈谯笪，年爱阳佟";
        firstName = firstName.replace("，", "").replace("。", "").replace("\n", "");
        char[] firstNames = firstName.toCharArray();
        System.out.println("firstNames的数量: " + firstNames.length);

        String lastName = "郝清秋81金,水,金男孩或女孩康煜祺82木,火,木男孩张文彬80火,水,木男孩汤涵涵97水,水,水男孩或女孩郝启博93金,木,水男孩董知秋81火,火,金男孩或女孩冯自清86水,火,水男孩林初静85木,金,金女孩江致远86水,火,土男孩万卓群81水,火,木男孩吕霏霏88火,水,水女孩孔花晨81木,木,金女孩熊天诚93水,火,金男孩孙翰飞81金,水,水男孩或女孩邓圣哲81火,土,火男孩韩雄杰82水,水,木男孩潘一鸣83水,土,水男孩文齐光85水,金,火男孩蒋涵涵82木,水,水男孩或女孩潘思文83水,金,水男孩秦语晖81火,木,水男孩或女孩汪卓群80水,火,木男孩董汪伦89火,水,火男孩徐启博93金,木,水男孩毛云飞88水,水,水男孩苏海平廖芳菲82火,木,木女孩杜秋水80木,金,水男孩或女孩白博文83水,水,水男孩韩进思88水,火,金男孩白子龙80水,水,火男孩崔怀文92木,水,水男孩邵白涛80金,水,水男孩汪锦江86水,金,水男孩罗向禹81火,水,土男孩熊月华93水,木,水女孩姜嘉月88木,木,木男孩或女孩彭兰舟82水,木,金女孩郝逢君80金,水,木男孩或女孩汤昆玉84水,火,木男孩龚汉青87木,水,金男孩廖修远82火,金,土男孩杜悦心80木,金,金男孩或女孩唐自修82火,火,金男孩杨昆玉84木,火,木男孩乔思文93木,金,水男孩赵月华93火,木,水女孩郝海生85金,水,金男孩蔡腾文88木,火,水男孩夏金玉87火,金,木女孩王海平81土,水,水男孩汪思源81水,金,水男孩";
        lastName = lastName.replace(",", "").
                replace("男", "").
                replace("女", "").
                replace("0", "").
                replace("1", "").
                replace("2", "").
                replace("3", "").
                replace("4", "").
                replace("5", "").
                replace("6", "").
                replace("7", "").
                replace("8", "").
                replace("9", "").
                replace("金", "").
                replace("木", "").
                replace("水", "").
                replace("火", "").
                replace("土", "").
                replace("孩", "").
                replace("\n", "");
        char[] lastNames = lastName.toCharArray();
        System.out.println("lastNames的数量: " + lastNames.length);


        List<String> names = new ArrayList<>();
        Random random = new Random();
        //设置随机生成姓名的数量
        for (int i = 0; i < 1000; i++) {
            String name1 = String.valueOf(firstNames[random.nextInt(firstNames.length)]);
            String name2 = String.valueOf(lastNames[random.nextInt(lastNames.length)]);
            String name3 = String.valueOf(lastNames[random.nextInt(lastNames.length)]);
            names.add(name1 + name2 + name3);

        }
        for (int i = 1; i < names.size(); i++) {
            System.out.print(names.get(i) + ",");
            if (i % 5 == 0) {
                System.out.println();
            }
        }
    }

    public String getRandomName() {
        String firstName = "赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张" +
                "孔曹严华金魏陶姜戚谢邹喻柏水窦章云苏潘葛奚范彭郎鲁韦昌马苗凤花" +
                "方俞任袁柳酆鲍史唐费廉岑薛雷贺倪汤滕殷罗毕郝邬安常乐于时傅皮卞" +
                "齐康伍余元卜顾孟平黄和穆萧尹姚邵湛汪祁毛禹狄米贝明臧计伏成戴谈" +
                "宋茅庞熊纪舒屈项祝董梁杜阮蓝闵席季麻强贾路娄危江童颜郭梅盛林刁" +
                "钟徐邱骆高夏蔡田樊胡凌霍虞万支柯昝管卢莫经房裘缪干解应宗丁宣贲" +
                "邓郁单杭洪包诸左石崔吉钮龚程嵇邢滑裴陆荣翁荀羊於惠甄曲家封芮羿" +
                "储靳汲邴糜松井段富巫乌焦巴弓牧隗山谷车侯宓蓬全郗班仰秋仲伊宫宁" +
                "仇栾暴甘钭厉戎祖武符刘景詹束龙叶幸司韶郜黎蓟薄印宿白怀蒲邰从鄂" +
                "索咸籍赖卓蔺屠蒙池乔阴鬱胥能苍双闻莘党翟谭贡劳逄姬申扶堵冉宰郦" +
                "雍卻璩桑桂濮牛寿通边扈燕冀郏浦尚农温别庄晏柴瞿阎充慕连茹习宦艾" +
                "鱼容向古易慎戈廖庾终暨居衡步都耿满弘匡国文寇广禄阙东欧殳沃利蔚" +
                "越夔隆师巩厍聂晁勾敖融冷訾辛阚那简饶空曾毋沙乜养鞠须丰巢关蒯相" +
                "查后荆红游竺权逯盖益桓公万俟司马上官欧阳夏侯诸葛闻人东方赫连皇" +
                "甫尉迟公羊澹台公冶宗政濮阳淳于单于太叔申屠公孙仲孙轩辕令狐钟离" +
                "宇文长孙慕容鲜于闾丘司徒司空丌官司寇仉督子车颛孙端木巫马公西漆" +
                "雕乐正壤驷公良拓跋夹谷宰父谷梁晋楚闫法汝鄢涂钦段干百里东郭南门" +
                "呼延归海羊舌微生岳帅缑亢况郈有琴梁丘左丘东门西门商牟佘佴伯赏南" +
                "宫墨哈谯笪年爱阳佟";
        char[] firstNames = firstName.toCharArray();
//        System.out.println("firstNames的数量: " + firstNames.length);
//        System.out.println(firstNames);

        String lastName = "郝清秋81金,水,金男孩或女孩康煜祺82木,火,木男孩张文彬80火,水,木男孩汤涵涵97水,水,水男孩或女孩郝启博93金,木,水男孩董知秋81火,火,金男孩或女孩冯自清86水,火,水男孩林初静85木,金,金女孩江致远86水,火,土男孩万卓群81水,火,木男孩吕霏霏88火,水,水女孩孔花晨81木,木,金女孩熊天诚93水,火,金男孩孙翰飞81金,水,水男孩或女孩邓圣哲81火,土,火男孩韩雄杰82水,水,木男孩潘一鸣83水,土,水男孩文齐光85水,金,火男孩蒋涵涵82木,水,水男孩或女孩潘思文83水,金,水男孩秦语晖81火,木,水男孩或女孩汪卓群80水,火,木男孩董汪伦89火,水,火男孩徐启博93金,木,水男孩毛云飞88水,水,水男孩苏海平廖芳菲82火,木,木女孩杜秋水80木,金,水男孩或女孩白博文83水,水,水男孩韩进思88水,火,金男孩白子龙80水,水,火男孩崔怀文92木,水,水男孩邵白涛80金,水,水男孩汪锦江86水,金,水男孩罗向禹81火,水,土男孩熊月华93水,木,水女孩姜嘉月88木,木,木男孩或女孩彭兰舟82水,木,金女孩郝逢君80金,水,木男孩或女孩汤昆玉84水,火,木男孩龚汉青87木,水,金男孩廖修远82火,金,土男孩杜悦心80木,金,金男孩或女孩唐自修82火,火,金男孩杨昆玉84木,火,木男孩乔思文93木,金,水男孩赵月华93火,木,水女孩郝海生85金,水,金男孩蔡腾文88木,火,水男孩夏金玉87火,金,木女孩王海平81土,水,水男孩汪思源81水,金,水男孩";
        lastName = lastName.replace(",", "").
                replace("男", "").
                replace("女", "").
                replace("0", "").
                replace("1", "").
                replace("2", "").
                replace("3", "").
                replace("4", "").
                replace("5", "").
                replace("6", "").
                replace("7", "").
                replace("8", "").
                replace("9", "").
                replace("金", "").
                replace("木", "").
                replace("水", "").
                replace("火", "").
                replace("土", "").
                replace("孩", "").
                replace("\n", "");
        char[] lastNames = lastName.toCharArray();
//        System.out.println("lastNames的数量: " + lastNames.length);

        Random random = new Random();
        String name1 = String.valueOf(firstNames[random.nextInt(firstNames.length)]);
        String name2 = String.valueOf(lastNames[random.nextInt(lastNames.length)]);
        String name3 = String.valueOf(lastNames[random.nextInt(lastNames.length)]);

        return name1 + name2 + name3;
    }
}
